package com.myapp.web.struts2.interceptor;

import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.AbstractInterceptor;
import com.opensymphony.xwork2.util.logging.Logger;
import com.opensymphony.xwork2.util.logging.LoggerFactory;

public class ExceptionInterceptor extends AbstractInterceptor {

	private static final long serialVersionUID = 5174707395701762749L;
	
	private static final Logger logger = LoggerFactory.getLogger(ExceptionInterceptor.class);
	
	@Override
	public String intercept(ActionInvocation invocation) throws Exception {
		try
		{
			return invocation.invoke();
		}catch(Exception e)
		{
			logger.warn("exception :" + invocation.getClass(),e);
			throw e;
		}
		
	}

}
